#!/usr/bin/env ruby

puts ".result.state: FAILED"
$stdin.each_line do |line|
  match_data = line.match(/Result:\s(.*)/)
  if match_data
    value = match_data[1]
    puts ".result.state: #{value}"
  end
  match_data1 = line.match(/job_id:\s(.*)/)
  if match_data1
    job_id = match_data1[1]
    puts ".result.id: #{job_id}"
  end
  match_data2 = line.match(/result_root:\s(.*)/)
  if match_data2
    result_root = match_data2[1]
    puts ".result.result_root: #{result_root}"
  end
end
